<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>动画</title>
    <link rel="stylesheet" href="css/reset.css" />
    <style>
      /* 配置动画 */
      @keyframes divMove {
        /*  from {
          left: 0;
          top: 0;
          background-color: red;
        }
        to {
          left: 400px;
          top: 400px;
          background-color: green;
        } */

        0% {
          top: 0;
          left: 0;
          background-color: red;
        }
        25% {
          top: 0;
          left: 400px;
          background-color: green;
        }
        50% {
          top: 400px;
          left: 400px;
          background-color: blue;
        }
        75% {
          top: 400px;
          left: 0;
          background-color: yellow;
        }
        100% {
          top: 0;
          left: 0;
          background-color: red;
        }
      }

      div {
        position: absolute;
        width: 200px;
        height: 200px;
        background-color: red;

        /* 使用动画 */
        /* 动画名称 */
        /* animation-name: divMove; */
        /* 动画时长 */
        /* animation-duration: 10s; */
        /* 动画延迟 */
        /* animation-delay: 1s; */
        /* 动画时间曲线 */
        /* animation-timing-function: linear; */

        /*
          动画播放方向
          normal                正常播放
          reverse               反向播放
          alternate             奇正偶反
          alternate-reverse     奇反偶正
        */
        /* animation-direction: alternate; */

        /* 动画播放次数,取值数值次数或者infinite无限次 */
        /* animation-iteration-count: infinite; */

        /* 复合属性 */
        /* animation: name duration timing-function delay iteration-count direction fill-mode play-state; */
        animation: divMove 10s linear 1s infinite alternate;
      }
    </style>
  </head>
  <body>
    <div></div>
  </body>
</html>
